package cn.demo.text.editor.strategy.menu;

import cn.demo.text.editor.constant.Str;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;

public class FileMenu extends JMenu {

    public FileMenu(ActionListener actionListener) {
        super(Str.FILE);
        this.setFont(new MenuFont());
        this.setMargin(new Insets(0, 10, 0, 10));
        this.add(new ExitMenuItem(actionListener));
        this.add(new OpenMenuItem(actionListener));
        this.add(new PasswordMenuItem(actionListener));
        this.add(new SaveMenuItem(actionListener));
        this.add(new SaveAsMenuItem(actionListener));
        this.add(new SearchMenuItem(actionListener));
    }
}
